require '/Users/drewwhitehurst/thesis/vhdl/pixelpro/script/standard_file_parts.rb'
require '/Users/drewwhitehurst/thesis/vhdl/pixelpro/script/link_creator.rb'


vhd = File.new("test.vhd", "w")

# get user input for processor size
puts ("Input Columns (x):")
buffx = gets()
buffx = buffx.chomp()

puts ("Input Rows (y):")
buffy = gets()
buffy = buffy.chomp()

standard_write = Standard_VHD_File.new( vhd )
link_generator = Link_Creator.new(buffx.to_i(), buffy.to_i())

standard_write.write_beginning
standard_write.write_components
standard_write.write_global_signals
standard_write.write_active_links( link_generator.active_links )
standard_write.write_loop_back_signals( link_generator.boundary_loop_links )
standard_write.write_active_links_to_boundaries( link_generator.active_to_boundary_links )
standard_write.write_controller_signals_header()
standard_write.write_controller_signals( link_generator.active_controller_links_list )
standard_write.write_controller_signals( link_generator.boundary_controller_links_list )
standard_write.write_controller_header()
standard_write.write_controllers( link_generator.active_controller_links_list )
standard_write.write_controllers( link_generator.boundary_controller_links_list )


standard_write.write_closing

vhd.close()
